package cn.zwx.activiti.example.service.impl;

import cn.zwx.activiti.example.mapper.UserMapper;
import cn.zwx.activiti.example.model.bo.UserInfoBO;
import cn.zwx.activiti.example.model.po.UserPO;
import cn.zwx.activiti.example.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description:
 * @projectName:activiti-example
 * @see:cn.zwx.activiti.example.service.impl
 * @author:zhangwenxue
 * @createTime:2021/5/29 10:47
 * @version:1.0
 */
@Service
public class UserServiceImpl implements UserService {

    private Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);

    @Resource
    private UserMapper userMapper;


    /**
     * @description 根据用户名称查询用户信息
     * @return cn.zwx.activiti.example.model.po.UserPO
     * @author zhangwenxue
     * @createTime 2021/5/29 10:55
     **/
    @Override
    public UserPO selectUserByUserName(String userName) {
        UserInfoBO bo = new UserInfoBO();
        bo.setUserName(userName);
        return userMapper.selectOneUser(bo);
    }

    @Override
    public List<UserPO> selectAll() {
        return userMapper.selectAll();
    }
}
